home *** CD-ROM | disk | FTP | other *** search
/ SGI Developer Toolbox 6.1 / SGI Developer Toolbox 6.1 - Disc 4.iso / public / SciAn / src / ScianSockets.h < prev    next >
C/C++ Source or Header  |  1994-08-01  |  2KB  |  79 lines

  1. /*ScianSockets.h
  2.   External stuff for sockets in Scian
  3.   Eric Pepke
  4. */
  5.  
  6. extern int socketState;
  7.  
  8. /*Socket connection structure*/
  9. typedef struct 
  10.     {
  11.     Thing thing;            /*The thing part*/
  12.     int sock;            /* socket fd */
  13.     int gotCmdEnd;            /* true if we found a \n or a \0 */
  14.     int template;            /*File descriptor template,
  15.                       ONLY used on listener*/
  16.     } Connection, *ConnectionPtr;
  17.  
  18. #define CMD(s)  ((s)[0] * 16777216 + (s)[1] * 65536 + (s)[2] * 256 + (s)[3])
  19.  
  20. /*Timeouts*/
  21. #define TRYLATERTIME    5.0        /*Try later in 5.0 seconds*/
  22. #define JOHNSTIMEOUT    10.0        /*read/write timeout for sockets */
  23.  
  24. extern ObjPtr allAdvertised;
  25. extern ObjPtr advertiseableClass;        /*Class of advertiseable objects*/
  26.  
  27. /*Methods*/
  28. ObjPtr AdvertiseObject();
  29.  
  30. #ifdef PROTO
  31. int writen(int, char *, long);
  32. int readn(int, char *, long);
  33. void InitSockets(void);
  34. void KillSockets(void);
  35. Bool AllConnectionsIdle(Bool);
  36. Bool IdleAllConnections(void);
  37. Bool IdleConnection(ObjPtr);
  38. void DoConnectToComputer(void);
  39. void DoEnablePublication(void);
  40. void SendSocketCommandLater(ObjPtr connection, char *command);
  41. void SendObjectLater(ObjPtr, ObjPtr);
  42. ObjPtr NewLocalDaemonConnection(void);
  43. ObjPtr NewRemoteDaemonConnection(char *machineName);
  44. ObjPtr NewRemoteScianConnection(char *machineName, int port, ObjPtr process);
  45. ObjPtr NewListenerConnection(void);
  46. ObjPtr NewLocalScianConnection(int file);
  47. ObjPtr FindRemoteObject(ObjPtr, int, Bool);
  48. Bool WaitForNetObjectElement(ObjPtr, unsigned long);
  49. Bool WaitForNetObjectVar(ObjPtr, VarsPtr);
  50. Bool WaitForNetObject(ObjPtr, unsigned long);
  51. Bool ThisWouldBeAReallyBadThing(NameTyp var);
  52. Bool IsNetworkIDWaiting(ObjPtr process, unsigned long netid);
  53. void NetworkIDIsWaiting(ObjPtr process, unsigned long netid, Bool flag);
  54. #else
  55. int writen();
  56. int readn();
  57. void InitSockets();
  58. void KillSockets();
  59. Bool AllConnectionsIdle();
  60. Bool IdleAllConnections();
  61. Bool IdleConnection();
  62. void DoConnectToComputer();
  63. void DoEnablePublication();
  64. void SendSocketCommandLater();
  65. void SendObjectLater();
  66. ObjPtr NewLocalDaemonConnection();
  67. ObjPtr NewRemoteDaemonConnection();
  68. ObjPtr NewRemoteScianConnection();
  69. ObjPtr NewListenerConnection();
  70. ObjPtr NewLocalScianConnection();
  71. ObjPtr FindRemoteObject();
  72. Bool WaitForNetObjectElement();
  73. Bool WaitForNetObjectVar();
  74. Bool WaitForNetObject();
  75. Bool ThisWouldBeAReallyBadThing();
  76. Bool IsNetworkIDWaiting();
  77. void NetworkIDIsWaiting();
  78. #endif
  79.